<template>
    <div id="mi">
        <el-dialog
        :title="DialogData.title"
        :visible.sync="DialogData.show"
        width="50%"
        >
            <div class="table">
                <el-table
                    :data="tableData"
                    height="400"
                    border
                    style="width: 100%">

                    <el-table-column
                    prop="source"
                    align="center"
                    label="时间"
                    >
                        <template slot-scope="scope">
                            {{ scope.row.addtime }}
                        </template>
                    </el-table-column>

                    <el-table-column
                    prop="amount"
                    label="金额"
                    align="center"
                    >
                    </el-table-column>

                    <el-table-column
                    prop="source"
                    label="收支来源"
                    align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag>{{ scope.row.source | getType }}</el-tag>
                        </template>
                    </el-table-column>

                    <el-table-column
                    prop="source"
                    label="收支类型"
                    align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag :type="scope.row.type == 1 ? 'success' : 'danger' ">{{ scope.row.type == 1 ? "收入" : "支出" }}</el-tag>
                        </template>
                    </el-table-column>
                    
                </el-table>
            </div>
            <div class="money">
                <el-tag type="success">
                    余额: {{ AllMoney ? AllMoney : "0" }} 元
                </el-tag>
            </div>
        <span slot="footer" class="dialog-footer">
            <el-button @click="DialogData.show = false">取 消</el-button>
            <el-button type="primary" @click="DialogData.show = false">确 定</el-button>
        </span>
        </el-dialog>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                
            }
        },
        props: {
            DialogData: Object,
            tableData: Array,
            AllMoney: String
        },
        filters: {
			getType( val ) {
				let str = ""
				if(val == 1) {
					return "订单"
				} else if (val == 2) {
					return "创客"
				} else {
					return "提现"
				}
			}
		},
    }
</script>

<style lang="scss" scoped>
    .money {
        padding: 10px;
        text-align: right;
        // margin: 10px;
    }
</style>